import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

/*
@description 路由配置
@author ZhaoliangJi
@param  isNav  是否显示路由
@param  isPointer  路由是否可点击/添加样式 
@param  title  路由名称
@param  defaultState  默认是否展开
@time2021-11-12 14:20:11
*/
import { routeRegistered } from '@/config'
const routes = [
  {
    path: '/',
    name: 'HomeApp',
    component: routeRegistered['HomeApp'],
    meta: {
      isNav: true,
      isPointer: true,
      title: 'tsinghua-Ui'
    }
  },
  {
    path: '/introduce',
    name: 'Introduce',
    component: routeRegistered['Introduce'],
    meta: {
      isNav: true,
      isPointer: true,
      title: '介绍'
    }
  },
  {
    path: "/assembly",
    name: "Assembly",
    meta: {
      isNav: true,
      isPointer: false,
      defaultState: true,
      title: '组件库'
    },
    component: routeRegistered['Assembly'],
    children: [
      {
        path: "/assembly/button",
        name: "Button",
        component: routeRegistered['Button'],
        meta: {
          isPointer: true,
          isNav: true,
          title: "Button 按钮"
        },
      },

    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
